package com.aspose.cells;

class zaqo {
   private zapt a;
   private Workbook b;
   private zcfx c;
   private static final com.aspose.cells.b.c.a.za d = new com.aspose.cells.b.c.a.za(new String[]{"meta:editing-duration", "meta:editing-cycles", "meta:generator"});

   zaqo(zapt var1) {
      this.a = var1;
      this.b = var1.a;
   }

   void a(zcfx var1) throws Exception {
      this.c = var1;
      var1.c();
      var1.b("office:document-meta");
      var1.a("xmlns", "office", (String)null, "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
      var1.a("xmlns", "xlink", (String)null, "http://www.w3.org/1999/xlink");
      var1.a("xmlns", "dc", (String)null, "http://purl.org/dc/elements/1.1/");
      var1.a("xmlns", "meta", (String)null, "urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
      var1.a("xmlns", "ooo", (String)null, "http://openoffice.org/2004/office");
      this.a();
      var1.b();
      var1.d();
   }

   private void a() throws Exception {
      this.c.b("office:meta");
      BuiltInDocumentPropertyCollection var1 = this.b.getBuiltInDocumentProperties();
      if (!zbpt.a(var1.getLastSavedBy())) {
         this.c.b("meta:generator", var1.getLastSavedBy());
      }

      if (!zbpt.a(var1.getAuthor())) {
         this.c.b("meta:initial-creator", var1.getAuthor());
      }

      if (!zbpt.a(var1.getSubject())) {
         this.c.b("dc:subject", var1.getSubject());
      }

      if (!zbpt.a(var1.getKeywords())) {
         this.c.b("meta:keyword", var1.getKeywords());
      }

      if (!zbpt.a(var1.getTitle())) {
         this.c.b("dc:title", var1.getTitle());
      }

      if (!zbpt.a(var1.getComments())) {
         this.c.b("dc:description", var1.getComments());
      }

      if (var1.contains("CreateTime")) {
         this.c.b("meta:creation-date", var1.getCreatedTime().b("yyyy-MM-dd'T'hh:mm:ss"));
      }

      if (var1.contains("LastSavedTime")) {
         this.c.b("dc:date", var1.getLastSavedTime().b("yyyy-MM-dd'T'hh:mm:ss"));
      }

      if (var1.contains("LastPrinted")) {
         this.c.b("meta:print-date", var1.getLastPrinted().b("yyyy-MM-dd'T'hh:mm:ss"));
      }

      CustomDocumentPropertyCollection var2 = this.b.getCustomDocumentProperties();

      for(int var3 = 0; var3 < var2.getCount(); ++var3) {
         DocumentProperty var4 = var2.get(var3);
         switch(d.a(var4.getName())) {
         case 0:
         case 1:
         case 2:
            this.c.b(var4.getName(), com.aspose.cells.b.a.zr.a(var4));
            break;
         default:
            this.a(var4);
         }
      }

      this.c.b();
   }

   private void a(DocumentProperty var1) throws Exception {
      this.c.b("meta:user-defined");
      this.c.a("meta:name", var1.getName());
      String var2 = null;
      String var3 = null;
      switch(var1.getType()) {
      case 0:
         var2 = "boolean";
         var3 = (Boolean)var1.getValue() ? "true" : "false";
         break;
      case 1:
         var2 = "date";
         var3 = ((DateTime)var1.getValue()).b("yyyy-MM-dd'T'hh:mm:ss");
         break;
      case 2:
      case 3:
         var2 = "float";
         var3 = com.aspose.cells.b.a.zr.a(var1);
         break;
      default:
         var3 = com.aspose.cells.b.a.zr.a(var1);
      }

      if (var2 != null) {
         this.c.a("meta:value-type", var2);
      }

      this.c.a(var3);
      this.c.b();
   }
}
